//
//  UIApplicationExt.m
//  mobion Music
//
//  Created by Vu Manh Hung on 11/26/10.
//  Copyright 2010 GNT. All rights reserved.
//

#import "UIApplicationExt.h"


static int networkActivityCount = 0;

@implementation UIApplication(Ext)

- (void)showNetworkActivityIndicatorVisible:(BOOL)flag {
    if (flag){
        networkActivityCount++;
        [self setNetworkActivityIndicatorVisible:flag];
    } else {        
        networkActivityCount--;
        if (networkActivityCount <= 0) {
            networkActivityCount = 0;
            [self setNetworkActivityIndicatorVisible:NO];
        }
    }    
}

@end
